<template>
    <div class="login-box">
        <h1>发送</h1>
        <input v-model="msg" placeholder="msg"></input><br>
        <input v-model="nickname" placeholder="nickname"></input><br>
        <button @click="send">发送</button>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                msg: '',
                nickname: ''
            }
        },
        mounted() {

        },
        methods: {
            send() {
                let data = {
                    "msg": this.msg,
                    "nickname": this.nickname
                };
                this.$resource('/api/msg/submit').save(data).then(res => {
                    console.log(res);
                })
            }
        }
    }
</script>
<style scoped>
    .login-box {
        text-align: center;
        width: 500px;
        margin: 100px auto 0;
    }
</style>
